package io;

import com.sun.org.apache.xerces.internal.impl.xs.SchemaNamespaceSupport;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

/**
 * @User: vitobo
 * @Date: 2024-08-13
 * @Description:  Scanner是搭配流对象使用的
 *
 *
 */
public class IODemo10 {
    public static void main(String[] args) {
        // System.in 其实就是一个输入流对象
        //Scanner scanner = new Scanner(System.in);
        try(InputStream inputStream = new FileInputStream("f:/test.txt")){
            Scanner scanner = new Scanner(System.in);

            // 此时读取的内容就是从文件进行读取了;
            scanner.next();
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
